import { IsNotNullOrUndefined } from "@lib/helper";
import { type Component, splitProps, Show } from "solid-js";
import type { TableCaptionProps } from "./types";

const TableCaption: Component<TableCaptionProps> = (props) => {
    const [local, attributes] = splitProps(props, ["$ServerOnly"]);
    return (
        <Show when={IsNotNullOrUndefined(props.children)}>
            <caption {...(attributes as any)}>{props.children}</caption>
        </Show>
    );
};

export default TableCaption